import time
st=time.time
def bubble(f):
    a=[]
    for i in  f:
        a.append(int())
    st=time.time()
    for i in range (len(a)-2):
        for y in range(i+1,len(a)-1):
            if a[y]>a[y+1]:
                a[y],a[y+1]=a[y+1],a[y]
    end=time.time()
    return end-st

f1=open('m1_sorted.txt')
f2=open('m2_reverse.txt')
f3=open('m3_shuffle.txt')
print('m1_sorted',int(bubble(f1)*1000),'milliseconds')
print('m2_reverse',int (bubble(f2)*1000),'milliseconds')
print('m3_shuffle',int (bubble(f3)*1000),'milliseconds')

